public class Sum {
    public static int sumTest(int n) {
        int sum = 0;
        for (int i = 1; i <=n; i++) {
            sum += test(i);
        }
        return sum;
    }
    public static int test(int  n) {
        if(n == 1) {
            return 1;
        }
        return  n * test(n-1);
    }

    public static void main(String[] args) {
        System.out.println(sumTest(5));
    }
}
